package com.sixth.controller;

import com.sixth.entity.EduTeacher;
import com.sixth.entity.TbCheckTeachers;
import com.sixth.service.TeacherlistService;
import com.sixth.until.CommonResult;
import com.sixth.until.TableResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: self-tui-education
 * @description:
 * @author: 高振杨
 * @create: 2022-04-15 17:53
 **/
@RestController
@RequestMapping("/teacher")
public class TeacherlistController {

    @Autowired
    private TeacherlistService teacherlistService;
    @PostMapping("/findTeacher/{pageCurrent}/{pageSize}")
    public TableResult findTeacher(@PathVariable Integer pageCurrent, @PathVariable Integer pageSize, @RequestBody EduTeacher teacher){
       return teacherlistService.findTeacher(pageCurrent,pageSize,teacher);
    }

    @PostMapping("/changeStatus")
    public CommonResult changeStatus(@RequestBody EduTeacher teacher){

        //System.out.println(teacher);

       return teacherlistService.updatestatus(teacher);
    }

    @PostMapping("/updateTeacher")
    public CommonResult updateTeacher(@RequestBody EduTeacher teacher){

       return teacherlistService.updateTeacher(teacher);
    }

    @PostMapping("/checkTeacher/findTeacherCheck/{pageCurrent}/{pageSize}")
    public TableResult findTeacherCheck(@PathVariable Integer pageCurrent, @PathVariable Integer pageSize, @RequestBody EduTeacher teacher){

       return teacherlistService.findTeacherCheck(pageCurrent,pageSize,teacher);
    }

    @PostMapping("/checkTeacher/changeTeacherCheck")
    public CommonResult changeTeacherCheck(@RequestBody TbCheckTeachers tbCheckTeachers){
       return teacherlistService.changeTeacherCheck(tbCheckTeachers);
    }



}
